/*
 *  array/zero.c
 *
 *  (C) 2011 Harry Wei
 */

#include <stdio.h>
#include <stdlib.h>
#include <string.h>

/*
 *  NOTE: If struct zero a = {5, {'a', 'b', 'c', 'd', 'e'}};
 *  But sizeof(struct zero) == sizeof(a);
 */

struct zero {
	int size;
	char data[0];
};

int main(void)
{
	struct zero *a = NULL;
	int count = 7;
	char *b = "jiawei";

	a = (struct zero *)malloc(
		sizeof(struct zero) + count);
	a->size = 7;
	memcpy(a->data, b, count);
	printf("%s\n", a->data);
	return 0;
}
